import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue'
import admin from '../views/admin.vue'
import Hospital from '../views/Hospital.vue'
import Department from '../views/Department.vue'
import Doctor from '../views/Doctor.vue'
import user from '../views/user.vue'
import order from '../views/order.vue'
import useradmin from '../views/useradmin.vue'
import userhome from '../views/userhome.vue'
import reservation from '../views/reservation.vue'
import registration from '../views/registration.vue'
import userpay from '../views/userpay.vue'
import medicine from '../views/medicine.vue'
import doctoradmin from '../views/doctoradmin.vue'
import checklist from '../views/checklist.vue'
import doctorinfo from '../views/doctorinfo.vue'
import paylists from '../views/paylists.vue'
import doctorpaylist from '../views/doctorpaylist.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: login
  },
  {
    path: '/doctoradmin',
    name: 'doctoradmin',
    component: doctoradmin,
    children: [
      {
        path: 'checklist',
        name: 'checklist',
        component: checklist
      },
      {
        path: 'doctorinfo',
        name: 'doctorinfo',
        component: doctorinfo
      },
      {
        path: 'doctorpaylist',
        name: 'doctorpaylist',
        component: doctorpaylist
      },
    ]
  },
  {
    path: '/useradmin',
    name: 'useradmin',
    component: useradmin,
    children: [
      {
        path: 'userhome',
        name: 'userhome',
        component: userhome
      },
    {
        path: 'reservation',
        name: 'reservation',
        component: reservation
      },{
        path: 'registration',
        name: 'registration',
        component: registration
      }
      ,{
        path: 'userpay',
        name: 'userpay',
        component: userpay
      },
      {
        path: 'paylists',
        name: 'paylists',
        component: paylists
      }
    ]
  },
  {
    path: '/admin',
    name: 'admin',
    component: admin,
    children: [
      {
        path: 'hospital',
        name: 'hospital',
        component: Hospital
      },
      {
        path: 'Department',
        name: 'Department',
        component: Department
      },
      {
        path: 'Doctor',
        name: 'Doctor',
        component: Doctor
      },
      {
        path: 'user',
        name: 'user',
        component: user
      },
      {
        path: 'order',
        name: 'order',
        component: order
      },
      {
        path: 'medicine',
        name: 'medicine',
        component: medicine
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
